import 'package:flutter_easyrefresh/easy_refresh.dart';

import '../model/language.dart';
import '../widget/easy_refresh/easy_refresh_footer.dart';
import '../widget/easy_refresh/easy_refresh_header.dart';

/// FileName public_text
///
/// @Author lax
/// @Date 2023/12/23
///
/// @Description

class PublicText {
  static String month1 = '1月';
  static String month2 = '2月';
  static String month3 = '3月';
  static String month4 = '4月';
  static String month5 = '5月';
  static String month6 = '6月';
  static String month7 = '7月';
  static String month8 = '8月';
  static String month9 = '9月';
  static String month10 = '10月';
  static String month11 = '11月';
  static String month12 = '12月';
  static String year = '年';
  static String day = '日';

  static String yes = '是';
  static String no = '否';
  static String confirm = '确认';
  static String cancel = '取消';

  static String pleaseSelect = '请选择';
  static String pleaseInput = '请输入';
  static String search = '搜索';
  static String goBack = '返回';

  static String noData = '暂无数据';
  static String refresh = '刷新';
  static String loadFailed = '加载失败';
  static String reload = '重新加载';

  static String refreshText = '下拉刷新';
  static String refreshReadyText = '松开后开始刷新';
  static String refreshingText = '正在刷新...';
  static String refreshedText = '刷新完成';
  static String refreshFailedText = '刷新失败';
  static String loadText = '上拉加载更多';
  static String loadReadyText = '松开后开始加载';
  static String loadingText = '正在加载...';
  static String loadedText = '加载完成';
  static String loadFailedText = '加载失败';
  static String noMoreText = '没有更多数据';

  static String album = '相册';
  static String takePhoto = '拍照';
  static String selectVideo = '选择视频';
  static String captureVideo = '拍摄视频';
  static String selectFile = '选择文件';
  static String viewImage = '查看图片';
  static String saveImage = '保存图片';
  static String saveSuccess = '已保存';
  static String copySuccess = '已复制';

  static String noStoragePermission = '没有存储权限';
  static String noPhotosVideoPermission = '没有照片/视频权限';
  static String noCameraPermission = '没有相机权限';
  static String noMicrophonePermission = '没有麦克风权限';

  // static String noFilePermission = '没有文件权限';
  static String pleaseOpenPermission = '请在设置中打开APP的权限';
  static String toSetting = '去设置';

  static update({Language? language}) {
    if (language != null && language.index <= 2) {
      month1 = ['1月', 'January', '1 월'][language.index];
      month2 = ['2月', 'February', '2 월'][language.index];
      month3 = ['3月', 'March', '3 월'][language.index];
      month4 = ['4月', 'April', '4 월'][language.index];
      month5 = ['5月', 'May', '5 월'][language.index];
      month6 = ['6月', 'June', '6 월'][language.index];
      month7 = ['7月', 'July', '7 월'][language.index];
      month8 = ['8月', 'August', '8 월'][language.index];
      month9 = ['9月', 'September', '9 월'][language.index];
      month10 = ['10月', 'October', '10 월'][language.index];
      month11 = ['11月', 'November', '11 월'][language.index];
      month12 = ['12月', 'December', '12 월'][language.index];
      year = ['年', 'Year', ' 년'][language.index];
      day = ['日', 'Day', ' 일'][language.index];

      yes = ['是', 'Yes', '예'][language.index];
      no = ['否', 'No', '아니요'][language.index];
      confirm = ['确认', 'Confirm', '확인'][language.index];
      cancel = ['取消', 'Cancel', '취소'][language.index];

      pleaseSelect = ['请选择', 'Please select', '선택하세요'][language.index];
      pleaseInput = ['请输入', 'Please input', '입력해 주세요'][language.index];
      search = ['搜索', 'Search', '검색'][language.index];
      goBack = ['返回', 'Go Back', '반환'][language.index];

      noData = ['暂无数据', 'No data', '일시 데이터 없음'][language.index];
      refresh = ['刷新', 'Refresh', '새로 고침'][language.index];
      loadFailed = ['加载失败', 'Failed to load', '로딩 실패'][language.index];
      reload = ['重新加载', 'Reload', '다시 로딩'][language.index];

      refreshText = ['下拉刷新', 'Pull down to refresh', '새로'][language.index];
      refreshReadyText =
          ['松开后开始刷新', 'Release to refresh', '풀면 새로고침 시작'][language.index];
      refreshingText = ['正在刷新...', 'Refreshing', '새로고침 중'][language.index];
      refreshedText =
          ['刷新完成', 'Refresh successful', '새로 고침 완성'][language.index];
      refreshFailedText =
          ['刷新失败', 'Failed to refresh', '새로 고침 실패'][language.index];
      loadText = ['上拉加载更多', 'Pull up to load more', '더보기'][language.index];
      loadReadyText =
          ['松开后开始加载', 'Release to load', '풀면 로딩 시작'][language.index];
      loadingText = ['正在加载...', 'Loading', '로딩중'][language.index];
      loadedText = ['加载完成', 'Load successful', '로딩 완성'][language.index];
      loadFailedText = ['加载失败', 'Failed to load', '로드 실패'][language.index];
      noMoreText = ['没有更多数据', 'No more data', '더 이상 데이터가 없습니다'][language.index];

      album = ['相册', 'Album', '앨범'][language.index];
      takePhoto = ['拍照', 'Take Photos', '사진 찍기'][language.index];
      selectVideo = ['选择视频', 'Select video', '동영상 선택'][language.index];
      captureVideo = ['拍摄视频', 'Take Video', '동영상 촬영'][language.index];
      selectFile = ['选择文件', 'Select File', '파일 선택'][language.index];
      viewImage = ['查看图片', 'View', '보기'][language.index];
      saveImage = ['保存图片', 'Save', '저장'][language.index];
      saveSuccess = ['已保存', 'Save Success', '저장됨'][language.index];
      copySuccess = ['已复制', 'Copied', '복사됨'][language.index];

      noStoragePermission =
          ['没有存储权限', 'No storage permission', '스토리지 권한 없음'][language.index];
      noPhotosVideoPermission = [
        '没有照片/视频权限',
        'No photo/video permission',
        '사진 / 비디오 사용 권한 없음'
      ][language.index];
      noCameraPermission =
          ['没有相机权限', 'No camera permission', '카메라 사용 권한 없음'][language.index];
      noMicrophonePermission = [
        '没有麦克风权限',
        'No microphone permission',
        '마이크 사용 권한 없음'
      ][language.index];
      // noFilePermission = ['没有文件权限', 'No file permission', '파일 사용 권한 없음'][language.index];
      pleaseOpenPermission = [
        '请在设置中打开APP的权限',
        'Please grant permission to open the app in the settings',
        '설정에서 APP 사용 권한 열기'
      ][language.index];
      toSetting = ['去设置', 'To Setting', '설정'][language.index];
    }
    EasyRefresh.defaultHeader = EasyRefreshHeader();
    EasyRefresh.defaultFooter = EasyRefreshFooter();
  }
}
